<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Read extends Start_Controller {

	public function __construct(){
		parent::__construct();
		$this->load->_model('model_news','news');
	}
	
	
	public function index()
	{
	}

    //重新定义方法的调用规则  获取URI第二段值
    public function _remap($method)
    {
         $this->_read($method);
    }
	
	/**
	 *  单页信息处理
	 */
	public function _read($id){


		$this->data['id'] = $id;
		
		
		
		//获取单页信息
		$data  = $this->news->get_info_items($id);
		//更新点击数
		$ADD_NUM = 1;
	    $this->db->set('hits',"hits+$ADD_NUM",false);
	    $this->db->where('id', $id);
	    $this->db->update($this->news->_table); 
		$this->data['data'] = $data;
		//$this->data['leftmenu'] = $this->_leftmenu($infodata['classid']);
		$this->data['pagename'] = $data['title'];		
		$this->_template('read',$this->data);
		
    }
    
	
	
	
}









